<template>
  <view class="pppp">
    <CommonHeader :title="$t('添加商品')" color="#262728" :is-right="true">
		</CommonHeader>
    <!-- #ifdef H5 -->
    <iframe :src="urllink" ref="webview" allow="*" scrolling="no"></iframe>
    <!-- #endif -->
  </view>
</template>

<script>
import { HTTP_SHOPPING_URL } from '@/config/app';
import CommonHeader from "@/pages/components/common-header.vue";

export default {
  data() {
    return {
      id: "",
      urllink: "",
    };
  },
  components: {
    CommonHeader,
  },
  methods: {},
  onLoad(options) {
 
    // let http = 'http://192.168.1.30:3333';
    // let url = `${http}/#/mobileLogin?token=${uni.getStorageSync('xzdToken')}`;
    if (uni.getStorageSync('xzdToken')) {
      let url = `${HTTP_SHOPPING_URL}/business/#/mobileLogin?token=${uni.getStorageSync('xzdToken')}`;
      this.urllink = url
    } 
    let lock = false;
    window.addEventListener("message", (e) => {
      if (e.data == "goback") {
        if (!lock) {
          lock = true;
          uni.navigateBack({
            delta: 1,
          });
        }
      
      }
    });
  },
};
</script>

<style scoped>
iframe {
  overflow: hidden;
  /* 隐藏滚动条 */
  width: 100vw;
  /* 设置宽度 */
  /* height: 100vh; */
  /* 设置高度 */
  border: none;
  flex: 1;
}
.pppp {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
</style>
